define(
	function (require, exports) {
		/**
		 * 页面加载完成时触发
		 * @param hashCode 路由ID
		 * @param data 传递数据对象
		 * @param cite 页面站点信息
		 */
		exports.ready = function (hashCode, data, cite) {
			yufp.custom.vue({
				el: cite.el,
				data: function () {
					var _this = this;
					var eventTypeOption = [{ key: 'G', value: '普通事件' },
					{ key: 'F', value: '文件事件' }];
					/*定义校验规则，只能填字母数字 下划线*/
					var valiCodes = function (rule, value, callback) {
						var reg = /^[0-9a-zA-Z_]{1,}$/;
						if (value && reg.test(value)) {
							if (value.length > 64) {
								callback(new Error('长度不能大于64位'));
							} else {
								callback();
							}
						} else if (value && !reg.test(value)) {
							callback(new Error('能填字母、数字和下划线'));
						} else {
							callback();
						}
					};
					/*作业流代码以点号开头或只能填字母数字 下划线*/
					var valiCodesDian = function (rule, value, callback) {
						var reg1 = /^[0-9a-zA-Z_]{1,}$/;
						var reg = /^\.[0-9a-zA-Z_]{1,}$/;
						if (value) {
							if (reg.test(value) || reg1.test(value)) {
								if (value.length > 64) {
									callback(new Error('长度不能大于64位'));
								} else {
									callback();
								}
							} else {
								callback(new Error('必须以.号开头或字母、数字和下划线组合'));
							}
						} else {
							callback();
						}
					};
					return {
						tbHeight:'0',						
						rules: {
							groupCode: [
								{ validator: valiCodesDian, trigger: 'blur' }
							]
						},
						searchFormdata: {},
						upLoadDataformdata: {},
						appNameDisabled: false,
						addFnButton: !yufp.session.checkCtrl('addFn'),
						updateFnButton: !yufp.session.checkCtrl('updateFn'),
						deleteFnButton: !yufp.session.checkCtrl('deleteFn'),

						addClassFnButton: !yufp.session.checkCtrl('addClassFn'),
						updateClassFnButton: !yufp.session.checkCtrl('updateClassFn'),
						deleteClassFnButton: !yufp.session.checkCtrl('deleteClassFn'),

						flowChartFnButton: !yufp.session.checkCtrl('flowChartFn'),
						importFnButton: !yufp.session.checkCtrl('importFn'),
						exportFnButton: !yufp.session.checkCtrl('exportFn'),

						validatorButton: !yufp.session.checkCtrl("validatorFn"),
						treeDataUrl: "api/use/plats/workflow/queryTreeList",
						dataUrl: 'api/use/plats/workflow/queryList',
						saveBtnShow: true,
						cancelBtnShow: true,
						addBtnShow: false,
						formdata: {},
						formdataRemark: {},
						upLoadUrl: yufp.service.getUrl({ url: "api/file/provider/uploadfile" }),
						appUploadDatas: [],
						async: false,
						height: yufp.frame.size().height -162,
						folderHeight: 300,
						dialogVisible: false,
						formDisabled: false,
						classCodeDisabled: false,
						viewTitleArrry: ['作业流添加', '作业流修改'],
						viewTitle: '',
						propTabaleData: [],
						eventTypeOption: eventTypeOption,
						appCodeShow: true,
						appShowName: "",
						nodeData: '', // 在新增表格数据时需要先获取当前树节点，再把一条新的记录加到这个节点下的表格里,
						nodeLeaf: false,
						isDisabledAppName: false,
						isReadOnly: false,
						isAppNode: false,
						isNodeLeaf: false,
						nodeLeafData: {},
						dataSources: [],
						currentClickNode: {},
						defaultFolderKey: [],
						isClassaddFlag: false,
						classCodeReadOnly: false,
						chooseFolderDialogVisible: false,
						isFileEvent: false,
						currAppNode: {},
						agentIds: [],
						filDatas: [],
						viewClassTitle: "",
						folderRoot: "",
						isView: false,
						viewClassTitleArrry: ['作业流目录添加', '作业流目录修改'],
						classDialogVisible: false,
						upLoadDialogVisible: false,
						importBusiData: {},
						paramValueValidate: [{ required: true, message: '必填项', trigger: 'blur' },
						{ message: '请输入数字', validator: yufp.validator.number }
						],

						relateDialogVisiable: false,
						searchRelFormdata: {},
						relDataUrl: "",

						flowRefAllVisiable: false,
						refAllFormdata: {},
						searchRefFormdata: {},
						//flowRefAllDataUrl: {},
						baseFlowRefParams: { condition: {} },
						flowRefAllDataUrl: 'api/use/plats/workflow/getWorkFlowRel',


						classFields: [{
							columnCount: 2,
							fields: [
								{
									field: 'appCode',
									label: '所属应用系统编号:',
									hidden: true
								},
								{
									field: 'appName',
									label: '所属应用系统:',
									disabled: true
								},
								{
									field: 'parentFolder',
									label: '上级目录名称:',
									hidden: true
								},
								{
									field: 'parentFolderName',
									label: '上级目录名称:',
									disabled: true
								},
								{
									field: 'folderCode',
									label: '目录代码:',
									maxlength: 64,
									rules: [
										{ validator: valiCodes, trigger: 'blur' }
									]
								},
								{
									field: 'folderName',
									label: '目录名称:',
									maxlength: 120,
									rules: [{ required: true, message: '必填项', trigger: 'blur' },
									{ max: 120, message: '输入值过长', trigger: 'blur' }]
								},

							]

						}, {
							columnCount: 1,
							fields: [

								{
									field: 'remark',
									label: '备注:',
									maxlength: 240,
									type: "textarea",
									rows: 3,
									rules: [{ max: 240, message: '输入值过长', trigger: 'blur' }]
								}
							]
						}],

						classButtons: [
							{
								label: '取消', hidden: false, click: function (model) {
									_this.cancelClassFn();
								}
							},
							{
								label: '保存', type: 'primary', hidden: false, op: 'submit', click: function (model, valid) {
									_this.saveClassCodeFn();
								}
							}

						],

						queryName: "",

						tableColumns: [
							{ label: '编号', type: "index" },
							{ label: '系统名称', prop: 'appName', hidden: false },
							{
								label: '作业流代码',
								prop: 'groupCode',
								template: function () {
									return '<template scope="scope">\
                               <a style="text-decoration:underline;color: #636CE4 " href="javascipt:void(0);"  @click="_$event(\'custom-detail-click\', scope.row)">{{ scope.row.groupCode }}</a>\
                           </template>';
								}
							},
							{ label: '作业流名称', prop: 'groupName' },
							{ label: '目录路径', prop: 'folderPath' },
							/*  { label: '操作', width:"200",
								template:function() {
											return '<template scope="scope"> <yu-button @click="_$event(\'custom-flow-click\', scope.row) "type="primary" size="small">流程图</yu-button>' +
													'  <yu-button @click="_$event(\'custom-flow-export\', scope.row)" type="success" size="small">导出</yu-button></template>';
									}
									}*/
						],
						//isReadOnly: false,
						nodeTemp: {},
					};
				},
				mounted:function(){
					var _this = this;
					//测试
					_this.$nextTick(function(){
							var tableBox = _this.$refs.tableBox;
							let a = tableBox.getBoundingClientRect().top + 28;
							var theight = `calc(100vh - ${a}px - 80px)`;
							_this.tbHeight = theight;		
					});
				},
				methods: {

					showRelAllFn: function (data) {

						var _this = this;
						var param = {};
						param.appCode = data.appCode;
						param.appName = data.appName;
						param.groupCode = data.groupCode;
						param.groupName = data.groupName;
						param.isShowFlowAllRef = true;

						//获取该作业流下的所有节点信息
						yufp.service.request({
							method: 'GET',
							url: "api/use/plats/workflow/queryWftLstList",
							data: { appCode: data.appCode, groupCode: data.groupCode },
							callback: function (code, message, response) {
								if (response.code == 0) {
									var wftLstOptions = [];
									var wftLstOptionsName = [];
									for (let i = 0; i < response.data.length; i++) {
										var val = response.data[i].actionName + '( '+response.data[i].actionCode+' )';//response.data[i].actionCode
										wftLstOptions.push({ key: response.data[i].actionCode, value:val ,actionName:response.data[i].actionName });
										//wftLstOptions.push({ key: response.data[i].actionCode, value: response.data[i].actionCode,actionName:response.data[i].actionName });
										wftLstOptionsName.push({ key: response.data[i].actionCode, value: response.data[i].actionName,actionName:response.data[i].actionCode });
									}

									param.wftLstOptions = wftLstOptions;
									param.wftLstOptionsName = wftLstOptionsName;
									_this.routeRefFlow(param);

								} else {
									_this.$message({ message: response.data, type: "warning", duration: 6000 });

								}
							}
						});



					},

					routeRefFlow: function (data) {

						var customKey = 'custom_' + new Date().getTime();
						var routeId = 'router_' + new Date().getTime();
						var url = 'pages/use/apps/jobManager/jobFlow/jobFlowRef';
						yufp.router.addRoute(routeId, {
							html: url + '.html',
							js: url + '.js'
						});
						yufp.frame.addTab({
							id: routeId,
							key: customKey,
							title: data.isShowFlowAllRef ? '作业流[' + data.groupName + ']血缘关系' : '作业流[' + data.groupName + ']依赖关系',
							data: data// 传递的业务数据，可选配置
						});
					},

					showFlowRefFn: function (data) {
						var _this = this;
						var param = {};
						param.appCode = data.appCode;
						param.appName = data.appName;
						param.groupCode = data.groupCode;
						param.groupName = data.groupName;
						param.isShowFlowAllRef = false;
						
						
						//获取该作业流下的所有节点信息
						yufp.service.request({
							method: 'GET',
							url: "api/use/plats/workflow/queryWftLstList",
							data: { appCode: data.appCode, groupCode: data.groupCode },
							callback: function (code, message, response) {
								if (response.code == 0) {								
									var wftLstOptions = [];
									var wftLstOptionsName = [];
									for (let i = 0; i < response.data.length; i++) {
										var val = response.data[i].actionName + '( '+response.data[i].actionCode+' )';//response.data[i].actionCode
										wftLstOptions.push({ key: response.data[i].actionCode, value:val ,actionName:response.data[i].actionName })
										//wftLstOptions.push({ key: response.data[i].actionCode, value: response.data[i].actionCode,actionName:response.data[i].actionName });
										wftLstOptionsName.push({ key: response.data[i].actionCode, value: response.data[i].actionName,actionName:response.data[i].actionCode });
									}
									param.wftLstOptions = wftLstOptions;
									param.wftLstOptionsName = wftLstOptionsName;
									_this.routeRefFlow(param);
						
								} else {
									_this.$message({ message: response.data, type: "warning", duration: 6000 });	
								}
							}
						});
						
						//this.routeRefFlow(param);

					},

					validateFn: function () {
						var _this = this;
						var selections = _this.$refs.refTable.selections;
						if (selections.length != 1) {
							_this.$message({ message: '请先选择一条记录', type: 'warning', duration: 6000 });
							return;
						}

						yufp.service.request({
							method: 'GET',
							url: "api/use/plats/workflow/checkWorkFlow",
							data: { appCode: selections[0].appCode, groupCode: selections[0].groupCode },
							callback: function (code, message, response) {
								if (response.code == 0) {
									_this.$message('校验通过');
									_this.classDialogVisible = false;

								} else {
									_this.$message({ message: response.data, type: "warning", duration: 6000 });
								}
							}
						});





					},

					reloadData: function () {

						var _this = this;
						var model = {};
						yufp.clone(_this.searchFormdata, model);
						model.appCode = _this.currentClickNode.appCode;
						if (_this.currentClickNode.nodeType === 'C') {
							model.folderCode = _this.currentClickNode.currentNodeId
						}

						var param = { condition: JSON.stringify(model) };
						_this.$refs.refTable.remoteData(param);
					},

					createTreeFn: function () {
						var _this = this;
						if (_this.currentClickNode == null
							|| _this.currentClickNode.nodeType == null
							|| _this.currentClickNode.nodeType === 'R') {
							_this.$message("请选择一个应用系统或目录");
							return;
						}
						_this.classDialogVisible = true;
						_this.viewClassTitle = _this.viewClassTitleArrry[0];
						_this.isClassaddFlag = true;
						_this.$set(_this.classFields[0].fields[4], 'readonly', false);
						/* _this.classCodeReadOnly = false;
						 _this.$set(_this.classFields[0].fields[2], 'readonly',  _this.classCodeReadOnly );*/
						_this.$nextTick(function () {
							_this.$refs.refClassForm.resetFields();
							_this.$refs.refClassForm.formModel.appCode = _this.currentClickNode.appCode;
							_this.$refs.refClassForm.formModel.appName = _this.currentClickNode.appName;

							if (_this.currentClickNode.nodeType === 'A') {
								_this.$refs.refClassForm.formModel.parentFolder = " ";
								_this.$refs.refClassForm.formModel.parentFolderName = "应用根目录";
							} else {
								_this.$refs.refClassForm.formModel.parentFolder = _this.currentClickNode.currentNodeId;
								_this.$refs.refClassForm.formModel.parentFolderName = _this.currentClickNode.currentNodeName;
							}


						});

					},
					cancelClassFn: function () {
						var _this = this;
						this.classDialogVisible = false;
					},

					selectFolder: function () {
						var _this = this;
						if (_this.addFlag) {
							_this.folderRoot = _this.currentClickNode.appCode;
						} else {
							_this.folderRoot = _this.$refs.refTable.selections[0].appCode;
						}

						_this.defaultFolderKey.splice(0);
						if (_this.formdata.folderCode != null) {
							_this.defaultFolderKey.push(_this.formdata.folderCode);

						}

						_this.chooseFolderDialogVisible = true;
						_this.$nextTick(function () {
							_this.$refs.refFolderTree.remoteData({});
						});

					},

					saveClassCodeFn: function () {

						var _this = this;
						var validate = false;
						_this.$refs.refClassForm.validate(function (valid) {
							validate = valid;
						});
						if (!validate) {
							return;
						}

						let urlparam = "";

						if (_this.isClassaddFlag) {
							urlparam = 'api/use/plats/workflow/saveCatalog';
						} else {
							urlparam = 'api/use/plats/workflow/updateCatalog';
						}

						yufp.service.request({
							method: 'POST',
							url: urlparam,
							data: _this.$refs.refClassForm.formModel,
							callback: function (code, message, response) {

								if (response.code == 0) {
									//paramObject.className = _this.queryField
									_this.$message('操作成功');
									_this.classDialogVisible = false;
									_this.$refs.refTree.remoteData({});
								} else {
									_this.$message(response.message);
								}
							}
						});

					},


					updateTreeFn: function () {
						var _this = this;

						if (_this.currentClickNode.nodeType != 'C') {
							_this.$message({ message: "请选择一个事件目录", type: "warning", duration: 6000 });
							return;
						}

						_this.classDialogVisible = true;
						_this.viewClassTitle = _this.viewClassTitleArrry[1];
						_this.$set(_this.classFields[0].fields[4], 'readonly', true);
						_this.isClassaddFlag = false;
						_this.classCodeReadOnly = true;
						_this.$nextTick(function () {
							_this.$refs.refClassForm.resetFields();
							_this.$refs.refClassForm.formModel.appCode = _this.currentClickNode.appCode;
							_this.$refs.refClassForm.formModel.appName = _this.currentClickNode.appName;
							_this.$refs.refClassForm.formModel.parentFolder = _this.currentClickNode.parentId;
							_this.$refs.refClassForm.formModel.parentFolderName = _this.currentClickNode.parentName;
							_this.$refs.refClassForm.formModel.folderCode = _this.currentClickNode.currentNodeId;
							_this.$refs.refClassForm.formModel.folderName = _this.currentClickNode.currentNodeName;
							_this.$refs.refClassForm.formModel.remark = _this.currentClickNode.remark;
						});

					},
					deleteTreeFn: function () {
						var _this = this;

						if (_this.currentClickNode.nodeType != 'C') {
							_this.$message({ message: "请选择一个作业流目录", type: "warning", duration: 6000 });
							return;
						}
						_this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							type: 'warning',
							duration: 6000,
							center: true,
							callback: function (action) {
								if (action === 'confirm') {
									let paramObj = {};
									paramObj.appCode = _this.currentClickNode.appCode;
									paramObj.folderCode = _this.currentClickNode.currentNodeId;

									yufp.service.request({
										method: 'DELETE',
										url: "api/use/plats/workflow/deleteCatalog",
										data: paramObj,
										callback: function (code, message, response) {
											if (response.code != 0) {
												_this.$message(response.message);
											} else {
												_this.$message('操作成功');
												_this.$refs.refTree.remoteData({});
												_this.$refs.refTable.remoteData({ condition: paramObj });
											}

										}
									});
								}
							}
						});
					},



					/**
					 * 取消
					 */
					cancelFn: function () {
						var _this = this;
						_this.dialogVisible = false;
					},
					/**
					 * 保存
					 */
					saveFn: function () {


						var _this = this;
						var validate = false;
						_this.$refs.refForm.validate(function (valid) {
							validate = valid;
						});
						if (!validate) {
							return;
						}
						var paramObj = _this.$refs.refForm.formdata;

						let urlparam = "";
						if (_this.addFlag) {
							urlparam = 'api/use/plats/workflow/saveWorkFlow';

						} else {
							urlparam = 'api/use/plats/workflow/updateWorkFlow';
						}


						yufp.service.request({
							method: 'POST',
							url: urlparam,
							data: paramObj,
							callback: function (code, message, response) {
								if (response.code == 0) {

									let appCode = "";
									let folderCode = "";

									if (_this.currentClickNode != null && _this.currentClickNode.nodeType != 'R') {
										appCode = _this.currentClickNode.appCode;
										if (_this.currentClickNode.nodeType === 'C') {
											folderCode = _this.currentClickNode.currentNodeId;
										}

									}

									var paramObj = {};
									paramObj.appCode = appCode;
									paramObj.folderCode = folderCode;
									var param = { condition: JSON.stringify(paramObj) };
									_this.$refs.refTable.remoteData(param);
									_this.$message('操作成功');
									_this.dialogVisible = false;
								} else {
									_this.$message(response.message);
								}
							}
						});
					},





					folderNodeClickFn: function (nodeData) {

						var checkObjects = this.$refs.refFolderTree.getCheckedNodes();
						for (var i = 0; i < checkObjects.length; i++) {
							if (nodeData.currentNodeId === checkObjects[i].currentNodeId) {
								continue;
							} else {
								this.$refs.refFolderTree.setChecked(checkObjects[i], false);
							}
						}

					},

					selectFolderSaveFn: function () {
						var _this = this;
						var checkObjects = this.$refs.refFolderTree.getCheckedNodes();
						if (checkObjects.length != 1) {
							_this.$message({ message: '请先选择一条记录', type: 'warning', duration: 6000 });
							return;
						} else {
							_this.formdata.folderCode = checkObjects[0].currentNodeId;
							_this.formdata.folderName = checkObjects[0].currentNodeName;
							_this.chooseFolderDialogVisible = false;
						}
					},

					selectFolderCancelFn: function () {
						var _this = this;
						var checkObjects = this.$refs.refFolderTree.getCheckedNodes();
						for (var i = 0; i < checkObjects.length; i++) {
							this.$refs.refFolderTree.setChecked(checkObjects[i], false);
						}

						_this.chooseFolderDialogVisible = false;
					},

					/**
					 * 点击树的结点，加载对应的数据
					 */
					nodeClickFn: function (nodeData, node, self) {
						var _this = this;
						_this.currentClickNode = nodeData;
						let appCode = "";
						let folderCode = "";

						if (nodeData.nodeType != 'R') {
							_this.isNodeLeaf = true;
							_this.tableColumns[1].hidden = true;
							_this.appNameDisabled = true;
							_this.searchFormdata.appName = nodeData.appName;
							appCode = nodeData.appCode;
							if (nodeData.nodeType === 'C') {
								folderCode = nodeData.currentNodeId
							}

						} else {
							_this.isNodeLeaf = false;
							_this.appNameDisabled = false
							_this.searchFormdata.appName = '';
							_this.tableColumns[1].hidden = false;
						}


						_this.searchFormdata.appCode = appCode;
						_this.searchFormdata.folderCode = folderCode;

						var param = { condition: JSON.stringify(_this.searchFormdata) };
						_this.$refs.refTable.remoteData(param);

					},
					/**
					 * 新增
					 */
					addFn: function () {
						var _this = this;
						_this.viewTitle = _this.viewTitleArrry[0];
						_this.addFlag = true;
						_this.isReadOnly = false;
						_this.dialogVisible = true;
						_this.isView = false;

						_this.$nextTick(function () {
							_this.$refs.refForm.resetFields();
							_this.formdata.appCode = _this.currentClickNode.appCode;
							if (_this.currentClickNode.currentNodeId === _this.currentClickNode.appCode) {
								_this.formdata.folderCode = _this.currentClickNode.currentNodeId;
								_this.formdata.folderName = "应用根目录";
							} else {
								_this.formdata.folderCode = _this.currentClickNode.currentNodeId;
								_this.formdata.folderName = _this.currentClickNode.currentNodeName;
							}

						});
					},

					viewDataFn: function (data) {
						var _this = this;
						_this.isReadOnly = true;
						_this.viewTitle = _this.viewTitleArrry[1];
						_this.dialogVisible = true;
						_this.addFlag = false;
						_this.isView = true;


						_this.$nextTick(function () {
							yufp.extend(_this.formdata, data);
							// yufp.extend(_this.formdataRemark, _this.$refs.refTable.selections[0]);
						});
					},

					/**
					 * 修改
					 */
					modifyFn: function () {
						var _this = this;
						if (_this.$refs.refTable.selections.length != 1) {
							_this.$message({ message: '请先选择一条记录', type: 'warning', duration: 6000 });
							return;
						}

						_this.isReadOnly = true;
						_this.viewTitle = _this.viewTitleArrry[1];
						_this.dialogVisible = true;
						_this.addFlag = false;
						_this.isView = false;


						_this.$nextTick(function () {
							/*    var paramObj = {};
									paramObj.appCode = _this.$refs.refTable.selections[0].appCode;*/
							yufp.extend(_this.formdata, _this.$refs.refTable.selections[0]);
							// yufp.extend(_this.formdataRemark, _this.$refs.refTable.selections[0]);
						});
					},
					/**
					 * 删除
					 */
					deleteFn: function () {
						var _this = this;
						var selections = _this.$refs.refTable.selections;
						if (selections.length != 1) {
							_this.$message({ message: '请先选择一条记录', type: 'warning', duration: 6000 });
							return;
						}

						_this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
							confirmButtonText: '确定',
							cancelButtonText: '取消',
							type: 'warning',
							duration: 6000,
							center: true,
							callback: function (action) {
								if (action === 'confirm') {
									yufp.service.request({
										method: 'DELETE',
										url: "api/use/plats/workflow/deleteWorkFlow",
										data: selections[0],
										callback: function (code, message, response) {
											if (response.code != 0) {
												isOk = false;
												_this.$message(response.message);
											} else {
												let appCode = "";
												let folderCode = "";

												if (_this.currentClickNode.nodeType != 'R') {
													appCode = _this.currentClickNode.appCode;
													if (_this.currentClickNode.nodeType === 'C') {
														folderCode = _this.currentClickNode.currentNodeId;
													}

												}

												var paramObj = {};
												paramObj.appCode = appCode;
												paramObj.folderCode = folderCode;
												var param = { condition: JSON.stringify(paramObj) };
												_this.$refs.refTable.remoteData(param);
												_this.$message('操作成功');
												_this.dialogVisible = false;

											}

										}
									});
								}
							}
						});
					},

					flowChartBarFn: function () {
						var selectRows = this.$refs.refTable.selections;
						if (!selectRows || selectRows.length === 0) {
							this.$message({ message: '请先选择一条记录', type: 'warning', duration: 6000 });
							return;
						}
						selectRows = selectRows[0];
						this.flowChartFn(selectRows);
					},

					/**
					 * 流程图
					 */
					flowChartFn: function (obj) {
						const selectRow = obj;

						/*if(obj!=null){
								selectRow = obj;
						}else{
								var selectRows = this.$refs.refTable.selections;
								if(!selectRows || selectRows.length === 0) {
										this.$message({ message: '请先选择一条记录', type: 'warning' });
										return;
								}
								selectRow = selectRows[0];
						}*/

						var customKey = 'custom_' + selectRow.appCode + '_' + selectRow.groupCode;
						var routeId = 'router_' + selectRow.appCode + '_' + selectRow.groupCode;
						// 由于groupCode中存在.符号，会导致document.querySelector获取对象失败，将对应的符号需要替换掉
						customKey = customKey.replace(/\./g, '');
						routeId = routeId.replace(/\./g, '');
						yufp.router.addRoute(routeId, {
							html: 'pages/use/apps/jobManager/jobFlowGraph/jobFlowGraph.html',
							js: 'pages/use/apps/jobManager/jobFlowGraph/jobFlowGraph.js'
						});
						yufp.frame.addTab({
							id: routeId, // 菜单功能ID（路由ID）
							key: customKey, // 自定义唯一页签key,请统一使用custom_前缀开头
							title: selectRow['groupName'] + ' 作业流', // 页签名称
							data: selectRow
						});
					},

					/**
					 * 流程图导入
					 */
					importFlowFn: function (obj) {
						this.upLoadDialogVisible = true;
						this.importBusiData = obj;

					},

					/**
					 * 导出
					 */
					exportFlowFn: function (obj) {

						if (this.$refs.refTable.selections.length == 0) {
							this.$message({ message: "请选择一条记录", type: "warning", duration: 6000 });
							return;
						} else {
							obj = this.$refs.refTable.selections[0];
						}
						yufp.util.download("api/use/plats/workflow/downLoadFlowXml?appCode=" + obj.appCode + "&groupCode=" + obj.groupCode);
					},

					/**
					 * check upload 操作
					 */
					checkUpload: function (file) {
						//alert(file);

						if (this.upLoadDataformdata.groupCode == null || this.upLoadDataformdata.groupCode == '') {
							this.$message.error('作业流代码不能为空');
							return false;
						}


						var isLt10M = file.size / 1024 / 1024 < 100;
						if (!isLt10M) {
							this.$message.error('上传文件大小不能超过 100MB!');
						}
						var index = file.name.lastIndexOf('.');
						var ext = file.name.substr(index + 1);

						var suffixValid = 'xml' === ext;
						if (!suffixValid) {
							this.$message.error('上传文件的格式必须为xml格式');
							return false;
						}
						return isLt10M && suffixValid;
					},

					successUpload: function (response, file, fileList) {

						const _this = this;
						const param = {};
						param.appCode = _this.currentClickNode.appCode;
						param.groupCode = _this.upLoadDataformdata.groupCode
						// param.appCode = this.importBusiData.groupCode;
						param.fileId = response.data.fileId;
						param.filePath = response.data.filePath;
						param.busNo = response.data.busNo;
						// param.adminFileUploadInfo = {} //response.data;

						yufp.service.request({
							method: 'GET',
							url: 'api/use/plats/workflow/upLoadFlowXml',
							data: param,
							callback: function (code, message, response) {
								if (response.code == 0) {
									//_this.$refs.refTable.remoteData();
									_this.reloadData();
									_this.$message('操作成功');
									_this.upLoadDialogVisible = false;
								} else {
									_this.$message({ message: response.message, type: "warning", duration: 6000 });
								}
							}
						});


					},



				},

			});
		};
	});